xen/arm: take the rank lock before accessing ipriority
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 13 Aug 2014 16:29:42 +0000 (17:29 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Sep 2014 14:23:26 +0000 (15:23 +0100)
commit446df2f7335f78f3368bc494212ce0e8adbad9db
treed5ab6233dfe4d6191a0e38203f15fb9712592977
parent07892f7fa14a51ef0378b415c151efa868419e30
xen/arm: take the rank lock before accessing ipriority

Currently we read ipriority from vgic_vcpu_inject_irq without taking the
rank lock. Fix that by taking the rank lock and reading ipriority at the
beginning of the function.

As vgic_vcpu_inject_irq is called from the irq.c upon receiving an
interrupt, we need to change the implementation of vgic_lock/unlock_rank
to spin_lock_irqsave to make it safe in irq context.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic.c
xen/include/asm-arm/vgic.h